package com.qtcm.nas.spc.yejibaobiao.web;


import com.qtcm.nas.spc.yejibaobiao.service.ImpYeJiBaoBiao_Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

/**
 * @Description说明: TODO
 * @Date 2022/7/16 9:04
 * @PackageName:com.jzyh.spc.login.service
 * @ClassName: ImpUserService
 * @Author作者: Spc
 * @Version 1.0
 * @自己写的注释:
 */
@Controller("yeJiBaoBiao_Controller")
@RequestMapping(value = "/yeji")
public class YeJiBaoBiao_Controller {
    @Autowired
    @Qualifier("yeJiBaoBiao_Service")
    private ImpYeJiBaoBiao_Service yeJiBaoBiao_service;

    @RequestMapping(value = "/baobiao")
    public String find7Day(Model model) {
        System.out.println("我跳转进来了啊");
        List list = yeJiBaoBiao_service.findOut_Day();
        System.out.printf("集合长度为" + list.size());
        int yi = (int) list.get(0);
        int yi1 = (int) list.get(1);
        int yi2 = (int) list.get(2);
        int yi3 = (int) list.get(3);
        int yi4 = (int) list.get(4);
        int yi5 = (int) list.get(5);
        int yi6 = (int) list.get(6);
//        System.out.println(yi6+"llllll");
        model.addAttribute("yi", yi);
        model.addAttribute("yi1", yi1);
        model.addAttribute("yi2", yi2);
        model.addAttribute("yi3", yi3);
        model.addAttribute("yi4", yi4);
        model.addAttribute("yi5", yi5);
        model.addAttribute("yi6", yi6);
        List<String> listsj = yeJiBaoBiao_service.findShijian();
        String shi1 = listsj.get(0);
        String shi2 = listsj.get(1);
        String shi3 = listsj.get(2);
        String shi4 = listsj.get(3);
        String shi5 = listsj.get(4);
        String shi6 = listsj.get(5);
        String shi7 = listsj.get(6);
        model.addAttribute("shi1", shi1);
        model.addAttribute("shi2", shi2);
        model.addAttribute("shi3", shi3);
        model.addAttribute("shi4", shi4);
        model.addAttribute("shi5", shi5);
        model.addAttribute("shi6", shi6);
        model.addAttribute("shi7", shi7);
        System.out.println("时间日期为" + shi6);
        return "business_Chart";
    }

//    @RequestMapping("/three")
//    public void threeDay(HttpServletRequest request, HttpServletResponse response) throws IOException {
//        List< Outstanding_Aem> listThree=yeJiBaoBiao_service.findOut_Day();
//        ResultBean resultBean=null;
//        if (listThree.size()>0) {
//            resultBean = new ResultBean(200,"查询成功",listThree);
//        }else {
//            resultBean = new ResultBean(202,"查询失败",null);
//        }
//        ObjectMapper objectMapper=new ObjectMapper();
//        String resulbean = objectMapper.writeValueAsString(resultBean);
//        response.getWriter().write(resulbean);
//    }

}
